<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<LINK href="showAllOrg.files/style.htm" rel=stylesheet>
		<LINK href="showAllOrg.files/content.htm" rel=stylesheet>
		
		<script type="text/javascript">
		    var djConfig = {
				isDebug:true,
				parseOnLoad:true,
				usePlainJson:true
		    };
		</script>
		 
		<script type="text/javascript" src="dojo/dojo/dojo.js"></script>
		<script type="text/javascript" src="dojo/dijit/dijit.js"></script>

		<script type="text/javascript">
    		dojo.require("dijit.form.Button");
    		dojo.require("dojo.rpc.JsonService");    	
    	</script>
		
		<script language="JavaScript" type="text/javascript">
			var makeShipperNoteService = new dojo.rpc.JsonService("box/order/MakeShipperNoteService?smd");
			
			//页面加载时的一些操作
			dojo.addOnLoad(load);
			function load() {
				initPage();
			}
			//得到当前日期
			function showDate() {
				var today = new Date();   
				var day = today.getDate();   
				var month = today.getMonth() + 1;   
				var year = today.getFullYear();   
				return year + "-" + month + "-" + day;
			}
			//初始化页面
			function initPage() {
				makeShipperNoteService.getOrderPlanID().addCallback(function (result) {
					document.getElementById("sn_num1").innerHTML = result;
					document.getElementById("sn_num2").value = result;
				});
				
				var cur_date = showDate();
			
				//上次更改日期为当前日期
				document.getElementById("sn_last_modified_date").value = cur_date;
	
				makeShipperNoteService.getAllocDetails().addCallback(function (AD) {
					console.dir(AD);
					//发货人信息
					document.getElementById("sender").innerHTML = AD.commission.sender.name;
					document.getElementById("sender_contact").innerHTML = AD.commission.sender.customerContact.name;
					document.getElementById("sender_tel").innerHTML = AD.commission.sender.customerContact.OTel;
					document.getElementById("sender_fax").innerHTML = AD.commission.sender.customerContact.fax;
					//收货人信息
					document.getElementById("receiver").innerHTML = AD.commission.receiver.name;
					document.getElementById("receiver_contact").innerHTML = AD.commission.receiver.customerContact.name;
					document.getElementById("receiver_tel").innerHTML = AD.commission.receiver.customerContact.OTel;
					document.getElementById("receiver_fax").innerHTML = AD.commission.receiver.customerContact.fax;
					//通知人信息
					document.getElementById("notifier").innerHTML = AD.commission.notifier.name;
					document.getElementById("notifier_contact").innerHTML = AD.commission.notifier.customerContact.name;
					document.getElementById("notifier_tel").innerHTML = AD.commission.notifier.customerContact.OTel;
					document.getElementById("notifier_fax").innerHTML = AD.commission.notifier.customerContact.fax;

					//收货地点
					document.getElementById("receive_loc").innerHTML = AD.commission.receiveLoc;

					makeShipperNoteService.getOrderPlan().addCallback(function (orderPlan) {
						console.dir(orderPlan);
						//船次
						document.getElementById("scd_id").innerHTML = orderPlan.shipSchedule.id;
						//船名
						document.getElementById("ship_name").innerHTML = orderPlan.shipSchedule.shipInfo.name;
					});

					//装货港
					document.getElementById("departure").innerHTML = AD.commission.departure;
					//卸货港
					document.getElementById("unload_loc").innerHTML = AD.commission.destination;
					//目的港
					document.getElementById("destination").innerHTML = AD.commission.destination;
					//TO
					document.getElementById("shipcom_name").innerHTML = AD.commission.shipComInfo.fullTitle;

					//货物信息
					makeShipperNoteService.getSnId().addCallback(function (snId) {
						makeShipperNoteService.getBoxAndGoods(snId).addCallback(function (BAG) {
							console.dir(BAG);

							var bag = BAG.list;
							var totalBox = 0;
							var totalWeight = 0;
							var totalSize = 0;
							
							var text = "";
							for (var i in bag) {
								text = text + "    <tr>";
								text = text + "        <td width='79' valign='top'>" + bag[i].box.id +"</td>";
								text = text + "        <td width='72' valign='top'>" + bag[i].box.leadSealing + "</td>";
								text = text + "        <td width='97' valign='top'>" + bag[i].goodsNum + "</td>";
								text = text + "        <td width='195' valign='top'>" + bag[i].goods.pack + ":" + bag[i].goods.name + "</td>";
								text = text + "        <td width='59' valign='top'>" + bag[i].goods.weight * bag[i].goodsNum + "</td>";
								text = text + "        <td width='68' valign='top'>" + bag[i].goods.size * bag[i].goodsNum + "</td>";
								text = text + "    </tr>";

								totalBox = totalBox + bag[i].goodsNum;
								totalWeight = totalWeight + bag[i].goods.weight * bag[i].goodsNum;
								totalSize = totalSize + bag[i].goods.size * bag[i].goodsNum;
							}
							//集装箱数或件数统计
							text = text + "<tr><td width='150' colspan='2' valign='top'><p><strong>集装箱数或件数统计</strong></p></td><td width='418' colspan='4' valign='top'>" + totalBox + " " + totalWeight + " " + totalSize + "</td></tr>";
					
							document.getElementById("goods_info").innerHTML = text;
						});
					});
					
					//费用信息
					makeShipperNoteService.getAllocDetails().addCallback(function (AD) {
						console.dir(AD);
	
						var commitedService = AD.commission.commitedService;
						makeShipperNoteService.getFeeItems().addCallback(function (feeItems) {
							console.dir(feeItems);
	
							var fee = feeItems.list;
							makeShipperNoteService.getSnId().addCallback(function (snId) {
								makeShipperNoteService.getBoxAndGoods(snId).addCallback(function (BAG) {
									console.dir(BAG);
		
									var bag = BAG.list;
									var weight = 0;
									for (var i in bag) {
										weight = weight + bag[i].goods.weight;
									}
									weight = weight * 1.0 / 1000;
									
									var text = "";
									text = text + "    <tr><td width='150' colspan='8' valign='top'><p><strong>费用条目</strong></p></td><td width='120' colspan='6' valign='top'><p><strong>费率</strong></p></td><td width='60' colspan='3' valign='top'><p><strong>数量</strong></p></td><td width='72' colspan='4' valign='top'><p><strong>费用</strong></p></td><td width='166' colspan='6' valign='top'><p><strong>预付或到付</strong></p></td></tr>";
		
									var rowCnt = 0;
									//一定有海运费
									for (var i in fee) {
										if (fee[i].name == "海运费") {
											text = text + "<tr>";
											text = text + "<td width='150' colspan='8' valign='top'>海运费</td>";
											text = text + "<td width='120' colspan='6' valign='top'>" + fee[i].std + fee[i].unitName + "</td>";
											text = text + "<td width='60' colspan='3' valign='top'>100海里, " + weight + "吨</td>";
											text = text + "<td width='72' colspan='4' valign='top'>" + fee[i].std * weight + "</td>";
											if (AD.commission.prePay == true) {
												text = text + "<td width='166' colspan='6' valign='top' id='prePay'>预付</td>";
											} else {
												text = text + "<td width='166' colspan='6' valign='top' id='prePay'>到付</td>";
											}
											text = text + "</tr>";
											rowCnt++;
											break;
										}
									}
									if (commitedService.declare == true) {				//报关费
										for (var i in fee) {
											if (fee[i].name == "报关费") {
												text = text + "<tr><td width='150' colspan='8' valign='top'>报关费</td>";
												text = text + "<td width='120' colspan='6' valign='top'>" + fee[i].std + fee[i].unitName + "</td>";
												text = text + "<td width='60' colspan='3' valign='top'>1单</td>";
												text = text + "<td width='72' colspan='4' valign='top'>" + fee[i].std + "</td></tr>";
												rowCnt++;
												break;
											}
										}
									}
									if (commitedService.inspect == true) {				//报检费
										for (var i in fee) {
											if (fee[i].name == "报检费") {
												rowCnt++;
												break;
											}
										}
									}
									if (commitedService.insure == true) {				//保险费
										for (var i in fee) {
											if (fee[i].name == "保险费") {
												rowCnt++;
												break;
											}
										}
									}
									if (commitedService.store == true) {				//仓储费
										for (var i in fee) {
											if (fee[i].name == "仓储费") {
												rowCnt++;
												break;
											}
										}
									}
									if (commitedService.trail == true) {				//拖车费
										for (var i in fee) {
											if (fee[i].name == "拖车费") {
												rowCnt++;
												break;
											}
										}
									}
									
									document.getElementById("fee_info").innerHTML = text;
									document.getElementById("prePay").rowSpan = rowCnt;
								});
							});
						});
					});
					//运输方式
					document.getElementById("transport_terms").innerHTML = AD.commission.transportTerms;
					//货物种类
					document.getElementById("goods_type").innerHTML = AD.commission.goods.type;
					//冷藏温度
					if (AD.commission.goods.tempUnit != null) {
						document.getElementById("goods_temp").innerHTML = AD.commission.goods.temp;
					} else {
						document.getElementById("goods_temp").innerHTML = "常温";
					}
					//危险等级
					document.getElementById("goods_dangerclass").innerHTML = AD.commission.goods.dangerClass;
					//Property
					document.getElementById("goods_dangerproperty").innerHTML = AD.commission.goods.dangerProperty;
					//UN NO.
					document.getElementById("goods_unid").innerHTML = AD.commission.goods.UNID;
					//备注
					makeShipperNoteService.getSnComments().addCallback(function (snComments) {
						if (snComments == null) {
							document.getElementById("comments").innerHTML = "";
						} else {
							document.getElementById("comments").innerHTML = snComments;
						}
					});
					//装箱场站名称
					makeShipperNoteService.getCyId().addCallback(function (cyId) {
						makeShipperNoteService.getCYInfo(cyId).addCallback(function (CY) {
							console.dir(CY);
							document.getElementById("cy_name").innerHTML = CY.name;
						});
					});			
					//分船
					if (AD.commission.multiShip == true) {
						document.getElementById("multiship").innerHTML = "Y";
					} else {
						document.getElementById("multiship").innerHTML = "N";
					}
					//分批
					if (AD.commission.multiSchedule == true) {
						document.getElementById("multischedule").innerHTML = "Y";
					} else {
						document.getElementById("multischedule").innerHTML = "N";
					}
					//有效期
					makeShipperNoteService.getSnDateOfExpiry().addCallback(function (snDateOfExpiry) {
						document.getElementById("expiry_date").innerHTML = snDateOfExpiry;
					});
					//制单日期
					document.getElementById("init_date").innerHTML = cur_date;
				});
			}
			//订舱
			function order_box() {
				window.open("订舱管理-缮制十联单.htm", "_self");
			}
			//关闭
			function close_shipper_note() {
				window.close();
			}
			//返回
			function go_back() {
				window.opener.focus();
				window.close();
			}
		</script>
		
		<title>订舱</title>
	</head>


	<body>

	<font face="隶书" color="3656B9" ; style="font-size: 18px;">缮制十联单</font><br>
	<img src="showAllOrg.files/line2.gif"><br>

<center>

	<table width="700" border="0" cellpadding="0" cellspacing="0" >		
     	 <tr height="80">
       <td class="ctitle" ><a id="sn_num1"></a>号十联单明细</td>
      </tr>
	</table>

	<table width="760" border="0" cellpadding="0" cellspacing="0" >
    <tr>
    <td	class="ctitle"  >上次更改日期：<input type="text" name="Bill_date" 
    id="sn_last_modified_date"  size=10 class="linputrl"></td>
	    
	
    <td class="ctitle"   >
    第<input  type="text" name="Bill_code"  id="sn_num2" size="19" class="linputrl"  >号
    </td>
	
	<td class="rtitle">单据类型：</td>  <td  	class="ltitle"><select name="Bill_type">
			<option value="I" selected="selected">初始化单据</option>
			  </select>        
          </td>
    </tr>
	</table>

	<table width="760">
    <tr>
      <td class="rtitle">
	   
	     <font face="Webdings" class="redcolor">4</font><a href="#" onClick="order_box()">订舱</a>
	
      <font face="Webdings" class="redcolor">4</font><a href="javascript:opAuditBill(document.formHidden,'opAuditBill')">打印</a>
      
   
      
	   
	  
	    
      <font face="Webdings" class="redcolor">4</font><a href="javascript:close_shipper_note()">关闭</a>
      
      
      <font face="Webdings" class="redcolor">4</font><a href="javascript:go_back()">返回</a>
      
	  </td>
	</tr>
</table>

<table cellspacing="0" cellpadding="0" border="1" class="titlearea">
  <tr>
    <td width="321" colspan="16" valign="top"><p><strong>发货人： </strong></p>
        <p id="sender"></p>
        <p>联系人： <a id="sender_contact"></a></p>
        <p>电话： <a id="sender_tel"></a> </p>
        <p>传真： <a id="sender_fax"></a> </p>
    </td>
    <td width="248" colspan="11" rowspan="7" valign="top"><p align="right"><strong>B/L NO. </strong>HDFC06E1342005 </p>
        <p align="right">&nbsp; </p>
        <p align="right">&nbsp; </p>
        <p>&nbsp; </p>
        <p align="right">&nbsp; </p>
        <p align="right">&nbsp; </p>
        <p align="right">&nbsp; </p>
        <p align="right">&nbsp; </p>
        <p align="right">TO ：<a id="shipcom_name"></a> </p>
        <p>FROM ：哈工大货代 </p>
        <p align="right">&nbsp; </p></td>
  </tr>
  <tr>
    <td width="321" colspan="16" valign="top"><p><strong>收货人： </strong></p>
        <p id="receiver"></p>
        <p>联系人： <a id="receiver_contact"></a> </p>
        <p>电话： <a id="receiver_tel"></a> </p>
        <p>传真： <a id="receiver_fax"></a> </p>
    </td>
  </tr>
  <tr>
    <td width="321" colspan="16" valign="top"><p><strong>通知人： </strong></p>
        <p id="notifier"> </p>
        <p>联系人： <a id="notifier_contact"></a> </p>
        <p>电话： <a id="notifier_tel"></a> </p>
        <p>传真： <a id="notifier_fax"></a> </p></td>
  </tr>
  <tr>
    <td width="145" colspan="7" valign="top"><p align="center"><strong>前程运输 </strong></p></td>
    <td width="176" colspan="9" valign="top"><p align="center"><strong>收货地点 </strong></p></td>
  </tr>
  <tr>
    <td width="145" colspan="7" valign="top"><p align="center">&nbsp; </p></td>
    <td width="176" colspan="9" valign="top"><p align="center" id="receive_loc">&nbsp; </p></td>
  </tr>
  <tr>
    <td width="96" colspan="6" valign="top"><p><strong>船名 </strong></p></td>
    <td width="97" colspan="4" valign="top"><p><strong>航次 </strong></p></td>
    <td width="128" colspan="6" valign="top"><p><strong>装货港 </strong></p></td>
  </tr>
  <tr>
    <td width="96" colspan="6" valign="top"><p id="ship_name"></p></td>
    <td width="97" colspan="4" valign="top"><p id="scd_id"></p></td>
    <td width="128" colspan="6" valign="top"><p id="departure"></p></td>
  </tr>
  <tr>
    <td width="150" colspan="8" valign="top"><p align="center"><strong>卸货港 </strong></p></td>
    <td width="233" colspan="12" valign="top"><p align="center"><strong>交货地点 </strong></p></td>
    <td width="186" colspan="7" valign="top"><p align="center"><strong>目的港 </strong></p></td>
  </tr>
  <tr>
    <td width="150" colspan="8" valign="top"><p id="unload_loc"></p></td>
    <td width="233" colspan="12" valign="top"><p>&nbsp; </p></td>
    <td width="186" colspan="7" valign="top"><p id="destination"></p></td>
  </tr>
  <tr>
    <td width="79" colspan="2" valign="top"><p align="center"><strong>集装箱号 </strong></p></td>
    <td width="72" colspan="6" valign="top"><p align="center"><strong>铅封号 </strong></p></td>
    <td width="97" colspan="4" valign="top"><p align="center"><strong>箱数或件数 </strong></p></td>
    <td width="195" colspan="11" valign="top"><p align="center"><strong>包装种类与货名 </strong></p></td>
    <td width="59" colspan="2" valign="top"><p align="center"><strong>毛重 </strong></p>
        <p align="center"><strong>( </strong><strong>公斤 ) </strong></p></td>
    <td width="68" colspan="2" valign="top"><p align="center"><strong>尺码 </strong></p>
        <p align="center"><strong>( </strong><strong>立方米 ) </strong></p></td>
  </tr>
  <tr>
  	<td colspan='27'>
  		<table cellspacing="0" cellpadding="0" border="0" id="goods_info">
  		</table>
  	</td>
  </tr>
  <tr>
  	<td colspan='27'>
  		<table cellspacing="0" cellpadding="0" border="0" id="fee_info">
  		</table>
  	</td>
  </tr>
  <tr>
    <td width="88" colspan="4" valign="top"><p align="center"><strong>兑换率 </strong></p></td>
    <td width="146" colspan="7" valign="top"><p align="center"><strong>预付地点 </strong></p></td>
    <td width="168" colspan="10" valign="top"><p align="center"><strong>到付地点 </strong></p></td>
    <td width="166" colspan="6" valign="top"><p align="center"><strong>签发地点 </strong></p></td>
  </tr>
  <tr>
    <td width="88" colspan="4" rowspan="3" valign="top"><p>&nbsp; </p></td>
    <td width="146" colspan="7" valign="top"><p>&nbsp;</p></td>
    <td width="168" colspan="10" valign="top"><p>&nbsp;</p></td>
    <td width="166" colspan="6" valign="top"><p>&nbsp;</p></td>
  </tr>
  <tr>
    <td width="146" colspan="7" valign="top"><p align="center"><strong>预付总额 </strong></p></td>
    <td width="168" colspan="10" valign="top"><p align="center"><strong>正本提单份数 </strong></p></td>
    <td width="166" colspan="6" valign="top"><p align="center"><strong>货值金额 </strong></p></td>
  </tr>
  <tr>
    <td width="146" colspan="7" valign="top"><p>&nbsp; </p></td>
    <td width="168" colspan="10" valign="top"><p>&nbsp; </p></td>
    <td width="166" colspan="6" valign="top"><p>&nbsp; </p></td>
  </tr>
  <tr>
    <td width="189" colspan="9" valign="top"><p align="center"><strong>运输方式 </strong></p></td>
    <td width="189" colspan="10" valign="top"><p align="center"><strong>货物种类 </strong></p></td>
    <td width="189" colspan="7" valign="top"><p align="center"><strong>冷藏温度 </strong></p></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="189" colspan="9" valign="top"><p id="transport_terms"></p></td>
    <td width="189" colspan="10" valign="top"><p id="goods_type"></p></td>
    <td width="189" colspan="7" valign="top"><p id="goods_temp"></p></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="31"><p align="center">危险品 </p></td>
    <td width="537" colspan="25" valign="top"><p>Class: <a id="goods_dangerclass"></a></p>
        <p>Property: <a id="goods_dangerproperty"></a></p>
        <p>IMDG Code Page: </p>
        <p>UN No.: <a id="goods_unid"></a></p></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="247" colspan="12" valign="top"><p><strong>发货人或代理名称地址 </strong></p></td>
    <td width="131" colspan="7" valign="top"><p><strong>联系人 </strong></p></td>
    <td width="189" colspan="7" valign="top"><p><strong>电话 </strong></p></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="247" colspan="12" valign="top"><p id="agent_name_addr">哈工大货代 黑龙江省哈尔滨市西大直街92号</p></td>
    <td width="131" colspan="7" valign="top"><p id="agent_contact">刘琳琳</p></td>
    <td width="189" colspan="7" valign="top"><p id="agent_tel">15045118445</p></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="94" colspan="5" valign="top"><p><strong>可否转船 </strong></p></td>
    <td width="95" colspan="4" valign="top"><p><strong>可否分批 </strong></p></td>
    <td width="118" colspan="6" valign="top"><p><strong>装期 </strong></p></td>
    <td width="36" colspan="3" rowspan="6"><p align="center"><strong>备注 </strong></p></td>
    <td width="84" colspan="4" rowspan="6" valign="top"><p id="comments"></p></td>
    <td width="140" colspan="4" valign="top"><p><strong>装箱场站名称 </strong></p></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="94" colspan="5" valign="top"><p id="multiship"></p></td>
    <td width="95" colspan="4" valign="top"><p id="multischedule"></p></td>
    <td width="118" colspan="6" valign="top"><p id="load_date">&nbsp; </p></td>
    <td width="140" colspan="4" rowspan="5" valign="top"><p id="cy_name"></p></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="189" colspan="9" valign="top"><p><strong>有效期 </strong></p></td>
    <td width="118" colspan="6" valign="top"><p><strong>制单日期 </strong></p></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="189" colspan="9" valign="top"><p id="expiry_date"></p></td>
    <td width="118" colspan="6" valign="top"><p id="init_date"></p></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="79" colspan="3" valign="top"><p><strong>海运费由 </strong></p></td>
    <td width="180" colspan="10" valign="top"><p><strong>&nbsp; </strong></p></td>
    <td width="48" colspan="2" valign="top"><p align="right"><strong>支付 </strong></p></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="307" colspan="15" valign="top"><p><strong>如预付运费托收承付，请填准银行帐号 </strong><strong></strong></p></td>
    <td width="1"></td>
  </tr>
</table>
</center>

</body>
</html>


